from gen import generate_input
from alg import KnightTour

n, start_x, start_y = generate_input()
print(f"Chessboard size: {n}x{n}")
print(f"Starting position: ({start_x}, {start_y})")

kt = KnightTour(n)
if kt.solve(start_x, start_y):
    board = kt.get_board()
    for row in board:
        print(' '.join(f"{cell:2}" for cell in row))
else:
    print("No solution found.")
